package com.itcam.tingshu.album.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itcam.tingshu.model.album.TrackInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.itcam.tingshu.vo.album.AlbumTrackListVo;
import com.itcam.tingshu.vo.album.TrackInfoVo;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

public interface TrackInfoService extends IService<TrackInfo> {

    /**
     * 上传声音
     * @param file
     * @return
     */
    Map<String, Object> uploadTrack(MultipartFile file);

    /**
     * 保存声音
     * @param trackInfoVo
     * @param userId
     */
    void saveTrackInfo(TrackInfoVo trackInfoVo, Long userId);

    /**
     * 删除声音
     * @param trackId
     */
    void removeTrackInfo(Long trackId);

    /**
     * 根据声音Id查询声音信息
     * @param trackId
     * @return
     */
    TrackInfo getTrackInfo(Long trackId);

    /**
     * 修改声音
     * @param trackId
     * @param trackInfoVo
     */
    void updateTrackInfo(Long trackId, TrackInfoVo trackInfoVo);

    /**
     * 根据专辑Id获取声音分页列表
     * @param albumTrackListVoPage
     * @param albumId
     * @param userId
     * @return
     */
    IPage<AlbumTrackListVo> findAlbumTrackPage(Page<AlbumTrackListVo> albumTrackListVoPage, Long albumId, Long userId);

    /**
     * 播放声音
     * @param userId
     * @param trackId
     * @return
     */
    Map<String, Object> getPlayToken(Long userId, Long trackId);


    /**
     * 获取用户声音分集购买支付列表
     * @param trackId
     * @param userId
     * @return
     */
    List<Map<String, Object>> findUserTrackPaidList(Long trackId, Long userId);

    /**
     * 批量获取下单付费声音列表
     * @param trackId
     * @param trackCount
     * @return
     */
    List<TrackInfo> findPaidTrackInfoList(Long trackId, Integer trackCount);
}
